package com.cpan.android.sms.z.demo;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.AdapterView.OnItemClickListener;

import com.cpan.android.sms.R;

public class GridViewDemo extends Activity {

	private Context mContext;
	private GridView mGridView;
	private AlertDialog mAlertDialog;

	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.sms_qqface_grid_view);
		mContext = this;
		mGridView = (GridView) findViewById(R.id.sms_face_view);
		mGridView.setAdapter(new ImageFaceAdapter(mContext));
		mGridView.setOnItemClickListener(new OnItemClickListener() {
			public void onItemClick(AdapterView<?> a, View v, int p, long l) {
				Log.e("-------", p + "");
			}

		});
		mAlertDialog = new AlertDialog.Builder(mContext).setView(mGridView)
				.create();
		mAlertDialog.show();
	}

}
